/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 */
class MyArray<T extends Number>{
    public Object[] array = new Object[10]; //成员变量

    public void setVal(int pos ,T val){
        this.array[pos] = val;
    }
    public T getVal(int pos){
        return (T) this.array[pos];
    }
}
public class Test4 {
    public static void main(String[] args) {
        MyArray<Integer> myArray = new MyArray<Integer>();
       /* MyArray<String> myArray1 = new MyArray<>();*/

    }
    public static void main2(String[] args) {
        MyArray<Integer> myArray = new MyArray<Integer>();
        myArray.setVal(0,12);
        int a = myArray.getVal(0);
        System.out.println(a);
        myArray.setVal(1,20);
        int b = myArray.getVal(1);
        System.out.println(b);
    }
    public static void main1(String[] args) {
        MyArray<Integer> myArray = new MyArray<Integer>();
       /* MyArray<String> myArray1 = new MyArray<>();
        System.out.println(myArray);
        System.out.println(myArray1);*/
    }
}
